<?php 
require_once 'Abstracts.php';
class UserInfoModel extends Abstracts{
	
	protected $_table = 'pk_user_info';
	
        public function plusJetton ( $jetton , $userID ){
            if( 0 < $jetton ){
                $sql = " UPDATE ".$this->_table." SET jetton = jetton + ".$jetton." WHERE userID = '{$userID}' ";
                return $this->query($sql);
            }
        }
        
        public function minJetton ( $jetton , $userID ){
            if( 0 < $jetton ){
                $sql = " UPDATE ".$this->_table." SET jetton = jetton - ".$jetton." WHERE userID = '{$userID}' ";
                return $this->query($sql);
            }
        }
}